import torch

rnn = torch.nn.RNN(input_size=10, hidden_size=20, num_layers=2)
input = torch.randn(5, 3, 10)
input = torch.nn.utils.rnn.pack_padded_sequence(input=input, lengths=[4, 3, 3])
h0 = torch.randn(2, 3, 20)
output, hn = rnn(input, h0)
output = torch.nn.utils.rnn.pad_packed_sequence(sequence=output)
print(output)
print(hn)
